from selenium.webdriver.common.by import By

byid = By.ID
byname = By.NAME
bycname = By.CLASS_NAME
bytname = By.TAG_NAME
bylink = By.LINK_TEXT
bycss = By.CSS_SELECTOR
byxpath = By.XPATH
byparriallike = By.PARTIAL_LINK_TEXT

url = "http://10.59.9.8:7007/boss/login"

class JieSuan():
    # 结算管理
    jsgl_loc = byxpath, '/html/body/div[1]/div[2]/div[2]/div[2]/div[11]/h2'
    # 结算记录管理
    jsjl_manage_loc = byxpath, '/html/body/div[1]/div[2]/div[2]/div[2]/div[12]/ul/li/div/a'
    # 发起结算
    fqjs_loc = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[2]/div[2]/div[1]/ul/li[1]/a/span'
    # 查询用户编号icon        /html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[1]/div/fieldset/dl[1]/dd/a
    searchicon = bycname, 'btnLook'
    # 输入用户名
    username = byxpath, '/html/body/div[13]/div[2]/div[1]/form/div/table/tbody/tr/td[1]/input'
    # 点击查询
    searchbtn = byxpath, '/html/body/div[13]/div[2]/div[1]/form/div/table/tbody/tr/td[2]/div/div/button'
    # 选择第一个对钩
    select_one = byxpath, '/html/body/div[13]/div[2]/div[2]/div[2]/div[2]/div/table/tbody/tr[1]/td[7]/div/a'
    # 获取可结算余额
    kjsye = byxpath, '//a[text()="获取可结算余额"]'
    # 结算余额
    jsye = bycname, 'required.digits.textInput'
    # 提交
    commit = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[2]/ul/li[1]/div/div/button'
    # 审核
    shenhe = bycss, '#navTab > div.navTab-panel.tabsPageContent.layoutBox > div:nth-child(2) > div.pageContent.j-resizeGrid > div.grid > div.gridScroller > div > table > tbody > tr:nth-child(1) > td:nth-child(10) > div > a:nth-child(2)'
    # 审核备注
    shbz = bycss, '.required'
    # 审核提交
    commit2 = bycss, '.formBar > ul:nth-child(1) > li:nth-child(1) > div:nth-child(1) > div:nth-child(1) > button:nth-child(1)'
    # 打款
    dakuan = bycss, '.gridTbody > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(10) > div:nth-child(1) > a:nth-child(2)'
    # 打款备注
    dkbz = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[1]/div/fieldset/dl[2]/dd/input'
    # 打款提交
    commit3 = bycss, 'html body div#layout div#container div#navTab.tabsPage div.navTab-panel.tabsPageContent.layoutBox div.page.unitBox div.pageContent form div.formBar ul li div.buttonActive div.buttonContent button'
    # 断言 打款状态
    dkstatus = bycss, '#navTab > div.navTab-panel.tabsPageContent.layoutBox > div:nth-child(2) > div.pageContent.j-resizeGrid > div.grid > div.gridScroller > div > table > tbody > tr:nth-child(1) > td:nth-child(8) > div'


js = JieSuan()